﻿namespace SharpTalk.Client.WpfApplication.Controls
{
    using System.ComponentModel;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Input;
    using System.Windows.Media;
    using Core;


    /// <summary>
    /// Interaction logic for UserDetailsControl.xaml
    /// </summary>
    public partial class UserListViewItem : UserControl
    {
        public static readonly DependencyProperty ShowImageProperty = DependencyProperty.Register("ShowImage", typeof(bool), typeof(UserListViewItem));
        public static readonly DependencyProperty CornerBrushProperty = DependencyProperty.Register("CornerBrush", typeof(Brush), typeof(UserListViewItem));
        public static readonly DependencyProperty BorderBackgroundBrushProperty = DependencyProperty.Register("BorderBackgroundBrush", typeof(Brush), typeof(UserListViewItem));
        public static readonly DependencyProperty ShowActionButtonsProperty = DependencyProperty.Register("ShowActionButtons", typeof(bool), typeof(UserListViewItem));
        public static readonly DependencyProperty CurrentUserProperty = DependencyProperty.Register("CurrentUser", typeof(User), typeof(UserListViewItem));
        public static readonly DependencyProperty AddContactCommandProperty = DependencyProperty.Register("AddContactCommand", typeof(ICommand), typeof(UserListViewItem));
        public static readonly DependencyProperty ShowUserStatusProperty = DependencyProperty.Register("ShowUserStatus", typeof(bool), typeof(UserListViewItem));
        
        public UserListViewItem()
        {
            InitializeComponent();
        }

        [DisplayName(@"Current user")]
        [Description("Obtains or defines the current user")]
        public User CurrentUser
        {
            get { return GetValue(CurrentUserProperty) as User; }
            set { SetValue(CurrentUserProperty,value); }
        }

        [DisplayName(@"ShowUserImage")]
        [Description("Defines if the User image should be displayed")]
        public bool ShowImage
        {
            get { return (bool) GetValue(ShowImageProperty); }
            set { SetValue(ShowImageProperty,value); }
        }

        [DisplayName(@"CornerBrush")]
        [Description("")]
        public Brush CornerBrush
        {
            get { return GetValue(CornerBrushProperty) as Brush; }
            set { SetValue(CornerBrushProperty, value); }
        }

        [DisplayName(@"BorderBackgroundBrush")]
        [Description("")]
        public Brush BorderBackgroundBrush
        {
            get { return GetValue(BorderBackgroundBrushProperty) as Brush; }
            set { SetValue(BorderBackgroundBrushProperty, value); }
        }

        [DisplayName(@"ShowActionButtons")]
        [Description("")]
        public bool ShowActionButtons
        {
            get { return (bool)GetValue(ShowActionButtonsProperty); }
            set { SetValue(ShowActionButtonsProperty, value); }
        }

        [DisplayName(@"AddContactCommand")]
        [Description("")]
        public ICommand AddContactCommand
        {
            get { return GetValue(AddContactCommandProperty) as ICommand; }
            set { SetValue(AddContactCommandProperty, value); }
        }

        [DisplayName(@"ShowUserStatus")]
        [Description("Defines if the user status should be displayed")]
        public bool ShowUserStatus
        {
            get { return (bool) GetValue(ShowUserStatusProperty); }
            set { SetValue(ShowUserStatusProperty,value); }
        }
    }
}
